import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/login",
    component: () => import("@/views/login"),
  },
  {
    path: "/",
    component: () => import("@/views/layout"),
    redirect: "/home",
    children: [
      {
        // 帝可得主页
        path: "/home",
        component: () => import("@/views/home"),
      },
    ],
  },
  // 帝可得工单管理
  {
    path: "/task",
    component: () => import("@/views/layout"),
    redirect: "/task/business",
    children: [
      {
        // 运营工单
        path: "/task/business",
        component: () => import("@/views/task-business"),
      },
      {
        // 运维工单
        path: "/task/operation",
        component: () => import("@/views/task-operation"),
      },
    ],
  },
  // 点位管理
  {
    path: "/node",
    component: () => import("@/views/layout"),
    redirect: "/node/region",
    children: [
      {
        path: "/node/region",
        component: () => import("@/views/node-region"),
      },
      {
        path: "/node/node",
        component: () => import("@/views/node-node"),
      },
      {
        path: "/node/partner",
        component: () => import("@/views/node-partner"),
      },
    ],
  },
  // 设备管理
  {
    path: "/vm",
    component: () => import("@/views/layout"),
    redirect: "/vm/index",
    children: [
      {
        path: "/vm/index",
        component: () => import("@/views/vm-index"),
      },
      {
        path: "/vm/status",
        component: () => import("@/views/vm-status"),
      },
      {
        path: "/vm/type",
        component: () => import("@/views/vm-type"),
      },
    ],
  },
  // 人员管理
  {
    path: "/user",
    component: () => import("@/views/layout"),
    redirect: "/user/index",
    children: [
      {
        path: "/user/index",
        component: () => import("@/views/user-index"),
      },
      {
        path: "/user/user-task-stats",
        component: () => import("@/views/user-user-task-stats"),
      },
      {
        path: "/user/user-work",
        component: () => import("@/views/user-user-work"),
      },
    ],
  },
  // 商品管理
  // 策略管理
  // 订单管理
  // 对账统计
];

const router = new VueRouter({
  routes,
});

export default router;
